package com.konsung.ksdc.bean;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * 创建者     kgh
 * 创建时间   2016/5/30 11:17
 * 描述 即时消息
 * 更新者     $Author$
 * 更新时间   $Date$
 * 更新描述   ${TODO}
 */
@DatabaseTable(tableName = "MqttMsgBean")
public class MqttMsgBean {
    @DatabaseField(generatedId = true)
    private int msgId; //消息id
    @DatabaseField
    private String msgTargetType; //消息目标类型
    @DatabaseField
    private String msgType;  //消息类型
    @DatabaseField
    private String msgContent; //消息内容
    @DatabaseField
    private String msgSendDate; //消息发送时间
    @DatabaseField
    private String contact; //联系人
    @DatabaseField
    private String topicName; //主题名称
    @DatabaseField
    private String ownerUserId; //我的id
    @DatabaseField
    private boolean isRead = false; // 标记声音消息是否已经查阅
    @DatabaseField
    private long timeCount; // 语音消息时长

    /**
     * @return 消息id
     */
    public int getMsgId() {
        return msgId;
    }
    /**
     * @param  msgId 消息id
     */
    public void setMsgId(int msgId) {
        this.msgId = msgId;
    }
    /**
     * @return 消息类型
     */
    public String getMsgType() {
        return msgType;
    }
    /**
     * @param  msgType 消息类型
     */
    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
    /**
     * @return 消息内容
     */
    public String getMsgContent() {
        return msgContent;
    }
    /**
     * @param  msgContent 消息内容
     */
    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }
    /**
     * @return 消息发送时间
     */
    public String getMsgSendDate() {
        return msgSendDate;
    }
    /**
     * @param  msgSendDate 消息发送时间
     */
    public void setMsgSendDate(String msgSendDate) {
        this.msgSendDate = msgSendDate;
    }
    /**
     * @return 联系人
     */
    public String getContact() {
        return contact;
    }
    /**
     * @param  contact 联系人
     */
    public void setContact(String contact) {
        this.contact = contact;
    }
    /**
     * @return 主题名称
     */
    public String getTopicName() {
        return topicName;
    }
    /**
     * @param  topicName 主题名称
     */
    public void setTopicName(String topicName) {
        this.topicName = topicName;
    }
    /**
     * @return 消息目标类型
     */
    public String getMsgTargetType() {
        return msgTargetType;
    }
    /**
     * @param  msgTargetType 消息目标类型
     */
    public void setMsgTargetType(String msgTargetType) {
        this.msgTargetType = msgTargetType;
    }
    /**
     * @return 我的id
     */
    public String getOwnerUserId() {
        return ownerUserId;
    }
    /**
     * @param  ownerUserId 我的id
     */
    public void setOwnerUserId(String ownerUserId) {
        this.ownerUserId = ownerUserId;
    }

    /**
     * @return 声音消息是否已读
     */
    public boolean isRead() {
        return isRead;
    }

    /**
     * 设置声音是否已读状态
     * @param read 是否已读
     */
    public void setRead(boolean read) {
        isRead = read;
    }

    /**
     * 获取语音消息时长
     * @return 时长
     */
    public long getTimeCount() {
        return timeCount;
    }

    /**
     * 设置声音时长
     * @param timeCount 语音消息时长
     */
    public void setTimeCount(long timeCount) {
        this.timeCount = timeCount;
    }

    @Override
    public String toString() {
        return "MqttMsgBean{" +
                "msgId=" + msgId +
                ", msgTargetType='" + msgTargetType + '\'' +
                ", msgType='" + msgType + '\'' +
                ", msgContent='" + msgContent + '\'' +
                ", msgSendDate='" + msgSendDate + '\'' +
                ", contact='" + contact + '\'' +
                ", topicName='" + topicName + '\'' +
                ", ownerUserId='" + ownerUserId + '\'' +
                ", isRead='" + isRead + '\'' +
                ", timeCount='" + timeCount + '\'' +
                '}';
    }
}
